package cn.hznc.controller.toolAnalyze;

import cn.hznc.controller.service.toolAnalyze.MachineToolLogUsageRecordService;
import cn.hznc.domain.entity.MachineToolDataLog;
import cn.hznc.domain.entity.OrderEntity;
import cn.hznc.domain.request.device.DataLogMachineToolGroupReq;
import cn.hznc.domain.request.device.MachineToolDataDetailReq;
import cn.hznc.domain.request.order.QueryOrderReq;
import cn.hznc.domain.response.PageResult;
import cn.hznc.domain.response.ResponseBody;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@CrossOrigin(origins = "*", maxAge = 3600)
@RequestMapping("/analysisOfMachineToolUsage")
@Slf4j
public class AnalysisOfMachineToolUsageController {
    @Resource
    private MachineToolLogUsageRecordService machineToolLogUsageRecordService;

    @RequestMapping(value = "/queryMachineToolLogUsageRecord", method = RequestMethod.POST)
    public ResponseBody queryOrderList(@RequestBody DataLogMachineToolGroupReq dataLogMachineToolGroupReq) {
        return ResponseBody.success(machineToolLogUsageRecordService.queryMachineToolLogUsageRecord(dataLogMachineToolGroupReq));
    }

    @RequestMapping(value = "/queryAnalysisReportOnMachineToolUsage", method = RequestMethod.POST)
    public ResponseBody queryAnalysisReportOnMachineToolUsage(@RequestBody QueryOrderReq queryOrderReq) {
        return ResponseBody.success(machineToolLogUsageRecordService.AnalysisReportOnMachineToolUsage(queryOrderReq));
    }

    @RequestMapping(value = "/machineToolDataLogDetail", method = RequestMethod.POST)
    public ResponseBody machineToolDataLogDetail(@RequestBody MachineToolDataDetailReq machineToolDataDetailReq) {
        return ResponseBody.success(machineToolLogUsageRecordService.machineToolDataLogDetail(machineToolDataDetailReq));
    }
}
